package com.wing.res.model.request;

import com.wing.res.model.entity.ResProEchnologyParamVersionSku;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Objects;

/**
 * @version 1.1.0
 * @Author hz
 * @Date 2024-09-24 17:18
 **/
@Data
@NoArgsConstructor
@Accessors(chain = true)
public class ProcessProjectData {

    //工序名称
    private String name;
    //工序code
    private String proCode;
    //排序
    private Integer sorted;
    //内容
    private String content;
    //夹具
    private String fixture;
    //量具
    private String measuringTools;
    //工时定额(分钟)
    private BigDecimal hoursQuota;
    //工资定额(单位:元)
    private BigDecimal salaryQuota;
    //NG工资定额
    private BigDecimal ngSalaryQuota;


//    //成品料号
//    private String productDetailIds;

    //报工单位
    private Long unitId;

    //主记录id
    private Long paramsId;

//    //物料code
//    private String skuCode;
    private Long templateId;

    private Long creator;
    private String creatorName;
    private LocalDateTime createTime;
    private LocalDateTime updateTime;
    private String modifierName;
    private Long modifier;

    //版本物料信息
    private List<ResProEchnologyParamVersionSku> versionSkuList;

    @Override
    public boolean equals(Object o) {
        if (o == null || getClass() != o.getClass()) return false;
        ProcessProjectData that = (ProcessProjectData) o;
        return Objects.equals(name, that.name) && Objects.equals(proCode, that.proCode) && Objects.equals(content, that.content) && Objects.equals(fixture, that.fixture) && Objects.equals(measuringTools, that.measuringTools) && Objects.equals(hoursQuota, that.hoursQuota) && Objects.equals(salaryQuota, that.salaryQuota) && Objects.equals(ngSalaryQuota, that.ngSalaryQuota) && Objects.equals(unitId, that.unitId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, proCode, content, fixture, measuringTools, hoursQuota, salaryQuota, ngSalaryQuota, unitId);
    }

    @Override
    public String toString() {
        return "ProcessProjectData{" +
                "unitId=" + unitId +
                ", ngSalaryQuota=" + ngSalaryQuota +
                ", salaryQuota=" + salaryQuota +
                ", hoursQuota=" + hoursQuota +
                ", measuringTools='" + measuringTools + '\'' +
                ", fixture='" + fixture + '\'' +
                ", content='" + content + '\'' +
                ", sorted=" + sorted +
                ", proCode='" + proCode + '\'' +
                ", name='" + name + '\'' +
                '}';
    }
}
